Skip to content

Conversation

@nunofernandes
Copy link

Release notes

Upgrade Logstash Kinesis Input Plugin to AWS Kinesis Client Library (KCL) v2.7.2. This major version upgrade introduces enhanced compatibility with AWS SDK v2, improved LocalStack testing support, and more robust endpoint configuration.

What does this PR do?

  • Migrated from KCL v1.15.0 to v2.7.2
  • Added support for custom Kinesis, DynamoDB, and CloudWatch endpoint configuration
  • Updated AWS SDK dependencies to v2.33.0
  • Refactored worker and record processing logic
  • Enhanced error handling and logging
  • Added comprehensive integration test infrastructure with LocalStack
  • Improved proxy and credentials handling

Why is it important/What is the impact to the user?

This PR fixes an impending EOL on the AWS KCL v1*.

Checklist

  • My code follows the style guidelines of this project
  • [ X] I have commented my code, particularly in hard-to-understand areas
  • [ X] I have made corresponding changes to the documentation
  • [ X] I have made corresponding change to the default configuration files (and/or docker env variables)
  • [ X] I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • Please review the extensive changes in worker and configuration handling
  • Test with your specific Kinesis stream configurations
  • Verify compatibility with existing Logstash deployments

How to test this PR locally

You need to have docker compose and make.

make integration

Related issues

Use cases

n/a

Screenshots

n/a

Logs

Been running that in the last 24 hours without issues. Log volume is +70k logs / minute.

This commit sets up the development environment for the
logstash-input-kinesis plugin. It includes:

- .envrc: Configures JRuby, Logstash paths, AWS credentials
  (optional), and adds vendor jars to the classpath.
- .ruby-version: Specifies JRuby version.
- Makefile: Defines common tasks (install, test, clean).
- Rakefile: Uses jar-dependencies to manage Java dependencies.

The Jars::Installer.new.vendor_jars! method is now called with
`write_require_file: false` to prevent writing a require file.
- Migrate to Kinesis Client Library (KCL) v2.7.2
- Add support for custom endpoint configuration
- Improve LocalStack and testing compatibility
- Update AWS SDK dependencies and configuration
- Enhance error handling and logging
- Refactor worker and record processing logic
- Add integration test infrastructure

Update to 2.7.2
@cla-checker-service
Copy link

cla-checker-service bot commented Dec 16, 2025

💚 CLA has been signed

@nunofernandes
Copy link
Author

❌ Author of the following commits did not sign a Contributor Agreement: ff259f4, b48d78b

Please, read and sign the above mentioned agreement if you want to contribute to this project

Done!

@nunofernandes
Copy link
Author

Can't see any of the travis CI logs.. so 🤷

@javier-rodriguez-n26
Copy link

Can't see any of the travis CI logs.. so 🤷

Both jobs failed with the same error, look like there's something broken in the CI

env file /home/travis/build/logstash-plugins/logstash-input-kinesis/.ci/dockerjdk17.env not found: stat /home/travis/build/logstash-plugins/logstash-input-kinesis/.ci/dockerjdk17.env: no such file or directory

@felixho1
Copy link

May I ask, how to run the bundle to get the gem generated ?
First I ran bundle install successfully

bundle install

Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Fetching tilt 2.7.0
Fetching net-http 0.9.1
Fetching io-console 0.8.2 (java)
Fetching multi_json 1.19.1
Fetching kramdown 2.5.2
Fetching json 2.18.0 (java)
Fetching i18n 1.14.8
Fetching tzinfo-data 1.2025.3
Fetching ffi 1.17.3 (java)
Installing tilt 2.7.0
Installing multi_json 1.19.1
Installing i18n 1.14.8
Installing net-http 0.9.1
Installing tzinfo-data 1.2025.3
Installing io-console 0.8.2 (java)
Fetching reline 0.6.3
Installing json 2.18.0 (java)
Installing kramdown 2.5.2
Installing ffi 1.17.3 (java)
Installing reline 0.6.3
Fetching pry 0.16.0 (java)
Installing pry 0.16.0 (java)
Bundle complete! 6 Gemfile dependencies, 72 gems now installed.
Bundled gems are installed into `/Users/hofe/apps/elk/logstash-8.15.0/vendor/bundle/jruby`

Then I ran bundle exec rake vendor but failed with error Gem::LoadError: You have already activated jar-dependencies 0.4.1, but your Gemfile requires jar-dependencies 0.5.5. Since jar-dependencies is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports jar-dependencies as a default gem.

I did try AI to try help me, but still no luck.

This is the complete log

bundle exec rake vendor
bundler: failed to load command: rake (/Users/hofe/apps/elk/logstash-8.15.0/vendor/bundle/jruby/jruby/3.1.0/bin/rake)
Gem::LoadError: You have already activated jar-dependencies 0.4.1, but your Gemfile requires jar-dependencies 0.5.5. Since jar-dependencies is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports jar-dependencies as a default gem.
  check_for_activated_spec! at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:317
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:25
                       each at org/jruby/RubyArray.java:1981
                       each at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/spec_set.rb:229
                        map at org/jruby/RubyEnumerable.java:818
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:24
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler.rb:167
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/setup.rb:16
                 with_level at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/ui/shell.rb:173
                    silence at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/ui/shell.rb:119
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/setup.rb:16
                    require at org/jruby/RubyKernel.java:1184
           require_relative at org/jruby/RubyKernel.java:1213
                kernel_load at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli/exec.rb:57
                        run at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli/exec.rb:23
                       exec at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:452
                        run at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/command.rb:28
             invoke_command at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127
                   dispatch at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor.rb:538
                   dispatch at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:35
                      start at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/base.rb:584
                      start at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:29
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/exe/bundle:28
       with_friendly_errors at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/friendly_errors.rb:117
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/exe/bundle:20
                       load at org/jruby/RubyKernel.java:1220
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/bin/bundle:25
hofe@TAB118719 logstash-plugins/logstash-input-kinesis (nuno/issue-107-Kinesis-Client-Library-version-1.x-end-of-support) » bundle exec rspec                                                                                                  1 ↵
bundler: failed to load command: rspec (/Users/hofe/apps/elk/logstash-8.15.0/vendor/bundle/jruby/jruby/3.1.0/bin/rspec)
Gem::LoadError: You have already activated jar-dependencies 0.4.1, but your Gemfile requires jar-dependencies 0.5.5. Since jar-dependencies is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports jar-dependencies as a default gem.
  check_for_activated_spec! at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:317
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:25
                       each at org/jruby/RubyArray.java:1981
                       each at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/spec_set.rb:229
                        map at org/jruby/RubyEnumerable.java:818
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:24
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler.rb:167
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/setup.rb:16
                 with_level at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/ui/shell.rb:173
                    silence at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/ui/shell.rb:119
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/setup.rb:16
                    require at org/jruby/RubyKernel.java:1184
           require_relative at org/jruby/RubyKernel.java:1213
                kernel_load at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli/exec.rb:57
                        run at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli/exec.rb:23
                       exec at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:452
                        run at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/command.rb:28
             invoke_command at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127
                   dispatch at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor.rb:538
                   dispatch at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:35
                      start at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/base.rb:584
                      start at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:29
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/exe/bundle:28
       with_friendly_errors at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/friendly_errors.rb:117
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/exe/bundle:20
                       load at org/jruby/RubyKernel.java:1220
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/bin/bundle:25
hofe@TAB118719 logstash-plugins/logstash-input-kinesis (nuno/issue-107-Kinesis-Client-Library-version-1.x-end-of-support) » bundle exec rspec spec/inputs/kinesis_spec.rb                                                                      1 ↵
bundler: failed to load command: rspec (/Users/hofe/apps/elk/logstash-8.15.0/vendor/bundle/jruby/jruby/3.1.0/bin/rspec)
Gem::LoadError: You have already activated jar-dependencies 0.4.1, but your Gemfile requires jar-dependencies 0.5.5. Since jar-dependencies is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports jar-dependencies as a default gem.
  check_for_activated_spec! at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:317
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:25
                       each at org/jruby/RubyArray.java:1981
                       each at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/spec_set.rb:229
                        map at org/jruby/RubyEnumerable.java:818
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/runtime.rb:24
                      setup at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler.rb:167
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/setup.rb:16
                 with_level at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/ui/shell.rb:173
                    silence at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/ui/shell.rb:119
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/setup.rb:16
                    require at org/jruby/RubyKernel.java:1184
           require_relative at org/jruby/RubyKernel.java:1213
                kernel_load at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli/exec.rb:57
                        run at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli/exec.rb:23
                       exec at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:452
                        run at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/command.rb:28
             invoke_command at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127
                   dispatch at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor.rb:538
                   dispatch at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:35
                      start at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/vendor/thor/lib/thor/base.rb:584
                      start at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/cli.rb:29
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/exe/bundle:28
       with_friendly_errors at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/lib/bundler/friendly_errors.rb:117
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/lib/ruby/gems/shared/gems/bundler-2.6.9/exe/bundle:20
                       load at org/jruby/RubyKernel.java:1220
                     <main> at /Users/hofe/apps/elk/logstash-8.15.0/vendor/jruby/bin/bundle:25

@nunofernandes
Copy link
Author

Hello @felixho1 ,

I use fedora locally + logstash installed via rpm + direnv (that creates the required environment for building it). That said, I also included a Dockerfile so that the build process can be done independently of the "outside" environment. For that, you just need to have docker available and run:

$ docker build --target builder-kinesis --tag builder-kinesis .
$ docker run -ti -v $(pwd)/output:/output --entrypoint bash builder-kinesis -c "cp /build/logstash-input-kinesis-*.gem /output/"
$ ls -lah output/*gem
-rw-r--r--. 1 root root 66M Jan 24 15:14 output/logstash-input-kinesis-3.0.0-java.gem

@felixho1
Copy link

@nunofernandes Thank you so much for your help raising the PR. And thank you for the tips to build with docker.
I have tested locally on my machine, it works perfectly! Thank you once again.
I hope this PR get merged as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade AWS kinesis client library version asap Kinesis Client Library version 1.x end-of-support

3 participants